package com.gitee.wsl.mathematics.geometry.d2


import com.gitee.wsl.mathematics.geometry.d2.triangle.Triangle
import com.gitee.wsl.mathematics.vector.vec2.Vec2f
import com.gitee.wsl.mathematics.vector.vec3.Vec3f
import kotlin.test.Test
import kotlin.test.assertTrue

class TriangleTest {

    @Test
    fun barycentricCenter() {
        val t = Triangle(Vec2f(0.0, 0.0), Vec2f(100.0, 0.0), Vec2f(100.0, 100.0))
//        val centroid = t.centroid
//        val baryCenter = t.position(Vec3f(1.0/3.0, 1.0/3.0, 1.0/3.0))
//        assertTrue(centroid.distanceTo(baryCenter) < 1E-6)
    }
}